{template header.html}
<link rel="stylesheet" href="{SITE_PATH}dayrui/statics/css/style.css" />
<script type="text/javascript">
$(function() {
	{if IS_POST}
	$.dialog.tips("{lang('014')}", 3, 1);
	{/if}
});
function dr_left_selected(id) {
    if ($("#dr_left_"+id).attr('checked')) {
        $(".dr_left_"+id).attr("checked",true);
    } else {
        $(".dr_left_"+id).attr("checked",false);
    }
}
function dr_auth_selected(id) {
    if ($("#dr_link_"+id).attr('checked')) {
        $(".dr_link_"+id).attr("checked",true);
    } else {
        $(".dr_link_"+id).attr("checked",false);
    }
}
</script>
<style>
.menu_qx {
	width:10px;
}
.menu_gx {
	width:200px;
}
.menu_gg {
	width:120px;
}
.null_hover {
	background-color: #FFF !important;
}
.fixed {
	left: 85%;
    padding: 10px;
    position: fixed;
    top: 50%;
	background: none repeat scroll 0 0 #FFFCED;
    border: 1px solid #FFBE7A;
    padding: 8px 10px;
}
.d_top {
    width:100%;
    margin-bottom: 0px;
    margin-left: 0px;
    margin-right: 0px;
    float: left;
    border-top:none;
    border-right:none;
    border-bottom:none;
}
.d_name {
    border-right: 1px solid #C7D8EA;
}
.ltable {
    margin:5px 0;
}
.ltable td { padding: 5px 0  5px 10px;}
</style>
<form action="" method="post" name="myform" id="myform">
<div class="subnav">
	<div class="content-menu ib-a blue line-x" id="cc">
		{$menu}
	</div>
	<div class="bk10"></div>
	<div class="explain-col">
		<font color="gray">{lang('html-069')}</font>
	</div>
	<div class="bk10"></div>
    <div style="padding-right:1px;color:#3A6EA5">
        {php $uris = array();$sys = 1;}
        {loop $amenu $t}
        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #C7D8EA;">
            <tr>
                <td width="80" align="center"><b>{$t.name}</b></td>
                <td>
                    <div class="d_top">
                    {loop $t.left  $left}
                        <div class="d_name">
                            <input type="checkbox" id="dr_left_{$left.id}" onClick="dr_left_selected('{$left.id}')">&nbsp;
                            {$left.name}
                        </div>
                        <table class="ltable" width="100%" border="0" cellspacing="0" cellpadding="0">
                        {if $sys}
                        {php $sys=0;$left.link = $left.link+$syslink;}
                        {/if}
                        {loop $left.link $link}
                            {if !$link.url && !in_array($link.uri, $not_auth) && !in_array($link.uri, $uris)}
                            <tr>
                                <td width="120">
                                    <input name="data[]" type="checkbox" id="dr_link_{$link.id}" {if in_array($link.uri, $data.system)}checked{/if} class="dr_left_{$left.id}" value="{$link.uri}" onClick="dr_auth_selected('{$link.id}')">&nbsp;&nbsp;
                                    <span title="{$link.uri}">{$link.name}</span>
                                </td>
                                <td>
                                    {php $adata = $this->ci->_get_auth($link.uri);}
                                    {loop $adata $uri $name}
                                    {if $uri != $link.uri && !$mlink[$uri]}
                                    <input name="data[]" type="checkbox" class="dr_link_{$link.id} dr_left_{$left.id}" {if in_array($uri, $data.system)}checked{/if} value="{$uri}">&nbsp;
                                    <span title="{$uri}">{$name}</span>&nbsp;&nbsp;&nbsp;
                                    {/if}
                                    {/loop}
                                    {if $link.mark != 'module-weixin' && strpos($link.mark, 'module-') === 0 && strpos($link.uri, '/admin/home/index')}
                                    {php list($a, $dir) = explode('-', $link.mark);}
                                    &nbsp;&nbsp;&nbsp;
                                    {if in_array($dir, $mod_site)}
                                    <a href="{dr_url($dir.'/category/index')}">可管理栏目数量（{intval($mod_count[$dir])}）</a>
                                    {else}
                                    <font color="red">此模块尚未安装在当前站点中</font>
                                    {/if}
                                    &nbsp;&nbsp;&nbsp;
                                    <a href="http://help.dayrui.com/205.html" target="_blank">栏目权限设置方法</a>
                                    {/if}
                                </td>
                            </tr>
                            {/if}
                            {php $uris[] = $link.uri;}
                        {/loop}
                        </table>
                    {/loop}
                    </div>
                </td>
            </tr>
        </table>
        <div class="bk10"></div>
        {/loop}
    </div>
</div>

<div class="fixed-bottom">
    <div class="fixed-but text-c">
        <div class="button">
        	<input value="{lang('save')}" type="submit" name="submit" class="cu" style="width:100px;" />
        </div>
    </div>
</div>
</form>
{template footer.html}